﻿using AutoMapper;
using Microsoft.AspNetCore.Mvc;
using Model;
using Repository;
using Services;
using Utils.Enums;

namespace Api.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class UsersController : ControllerBase
    {
        private readonly IUsersService usersService;

        public UsersController(IUsersService _usersService)
        {
            usersService = _usersService;
        }

        [HttpGet]
        public MessageModel Get(int id)
        {
            var model = usersService.GetUsersById(id);

            MessageModel message = new MessageModel()
            {
                msg = "",
                data = model,
                status = 200,
                success = true
            };

            return message;
        }


        [HttpGet]
        public MessageModel GetNull()
        {
            var model = usersService.FindNull();

            MessageModel message = new MessageModel()
            {
                msg = "",
                data = model,
                status = 200,
                success = true
            };

            return message;
        }

    }
}
